Skip to content

Add long click at new Aqara Wireless Remote Switch#19518

Merged
syssi merged 2 commits intohome-assistant:devfrom
ppanagiotis:dev
Dec 22, 2018
Merged

Add long click at new Aqara Wireless Remote Switch#19518
syssi merged 2 commits intohome-assistant:devfrom
ppanagiotis:dev

Conversation

@ppanagiotis
Copy link
Copy Markdown
Contributor

New Aqara Wireless Remote Switch Single supports long click.
Return click_type = 'long' instead of False

Description:

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

  trigger:
    - platform: event
      event_type: click
      event_data:
        entity_id: binary_sensor.wall_switch_xxxxx
        click_type: long

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

New Aqara Wireless Remote Switch Single supports long click.
Return click_type = 'long' instead of False
@homeassistant
Copy link
Copy Markdown
Contributor

Hi @ppanagiotis,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@syssi
Copy link
Copy Markdown
Member

syssi commented Dec 22, 2018

Thanks for your PR! Could you tell me the model name of the new device?

@ppanagiotis
Copy link
Copy Markdown
Contributor Author

Thanks for your PR! Could you tell me the model name if the new device?

Sure. b186acn01. Introduced here 315f83e

Copy link
Copy Markdown
Member

@syssi syssi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we map long_both_click to long really?

@ppanagiotis
Copy link
Copy Markdown
Contributor Author

I don't have a new double Aqara Wireless Remote Switch to test the long_both_click.
For now I can rewrite this commit like this if you prefer:

        elif value == 'long_click':
            click_type = 'long'
        elif value == 'long_both_click':
            return False

@syssi
Copy link
Copy Markdown
Member

syssi commented Dec 22, 2018

I don't know anymore why the events was filtered for the first generation devices in the past. I will try to understand the implication of your change. Please give me some days for testing.

@ppanagiotis
Copy link
Copy Markdown
Contributor Author

I don't know anymore why the events was filtered for the first generation devices in the past. I will try to understand the implication of your change. Please give me some days for testing.

Sure.

Just fyi:
I have first generation single and double Aqara wireless switches. First generation switches only support single click (the single one) and single/both_click (the double one). With the current commit applied works just fine.

But I think I should filter out the long_both_click event and keep only long_click.

Thanks for your time.

@syssi
Copy link
Copy Markdown
Member

syssi commented Dec 22, 2018

Perfect! Please update your PR. I will approve it afterwards.

@ppanagiotis
Copy link
Copy Markdown
Contributor Author

Done!

@syssi
Copy link
Copy Markdown
Member

syssi commented Dec 22, 2018

Last thing: Coud you extend the Dokumentation? The table of the binary sensor page. Add the device plus the events.

@syssi syssi merged commit 07b6aae into home-assistant:dev Dec 22, 2018
@ghost ghost removed the in progress label Dec 22, 2018
dshokouhi pushed a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018
)

New Aqara Wireless Remote Switch Single supports long click.
@balloob balloob mentioned this pull request Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants